const { db, mongoose } = require("../config/dbConnect");
const frontendSchema = new mongoose.Schema({});
const backendSchema = new mongoose.Schema({});
const learningRecordSchema = new mongoose.Schema({
  date: {
    type: Date,
    default: new Date().toLocaleDateString(),
  },
  up: String,
  courseName: {
    type: String,
    unique: true,
  },
  desc: String,
  courseUrl: String,
  codePath: String,
  isOver: { type: Boolean, default: false },
});
const problemRecordSchema = new mongoose.Schema({});
const userRegisterySchema = new mongoose.Schema({
  useremail: {
    type: String,
    unique: true,
  },
  username: String,
  password: String,
});

const frontend = db.model("大前端", frontendSchema, "大前端");
const backend = db.model("大后端", backendSchema, "大后端");
const learningRecord = db.model("学习记录", learningRecordSchema, "学习记录");
const problemRecord = db.model("问题记录", problemRecordSchema, "问题记录");
const userRegistery = db.model("用户注册", userRegisterySchema, "用户注册");

module.exports = {
  frontend,
  backend,
  learningRecord,
  problemRecord,
  userRegistery,
};
